const arr = [1, 2, 3, 4, 5]
const nodeList = document.querySelectorAll('body')
const m = new Map()
m.set('a', 100)
m.set('b', 200)

function each(data) {
  for (const value of data) {
    console.log(value)
  }
}

each(arr)
each(nodeList)
each(m)